#include <STC15F2K60S2.H>
#include <Led.h>

void Led_Disp(unsigned char addr,enable){
	static unsigned char temp1 = 0x00;
	static unsigned char temp2 = 0xff;
	
	if(enable)
		temp1 |= 0x01<<addr;
	else
		temp1 &= ~(0x01<<addr);
	
	if(temp1 != temp2){
		P0 = ~temp1;
		P2 = P2 & 0x1f | 0x80;
		P2 &= 0x1f;
		temp2 = temp1;	
	}
}